import mockjs from 'mockjs';
import { delay } from 'roadhog-api-doc';
import defaultSettings from '../src/defaultSettings';

const proxy = {
  'GET /orgauth/SysuserRecentMenuController/getRecentMenuInfo.do': (req, res) => {
    res.send([
      {
        sysUserId: 1,
        postId: 92548,
        recentContent: '2780370',
        recentType: '1',
        statusCd: '1000',
        accessDate: '2020-02-16 13:57:22',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuName: '按钮',
        urlAddr: '/ui/buttons',
        menuCode: 'TYMH_MENU_AN',
      },
    ]);
  },
  'GET /orgauth/FuncMenuController/selectMenuFromSession.do': (req, res) => {
    res.status(200).send([
      {
        menuId: 3190500,
        menuName: '组件样例',
        menuLevel: 0,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 0,
        menuIndex: 1,
        menuDesc: '组件样例',
        urlAddr: 'Views',
        statusCd: '1000',
        firstLetter: 'ZJYLREACT',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_ZJYL',
      },
      {
        privId: 1402040,
        menuId: 3200500,
        menuName: 'Buttons',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 3190500,
        menuIndex: 1,
        menuDesc: '按钮',
        urlAddr: '/ui/buttons',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'BUTTONS',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_AN',
      },
      {
        privId: 1442040,
        menuId: 3240500,
        menuName: 'Modal',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 3190500,
        menuIndex: 5,
        urlAddr: '/ui/modal',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'MODAL',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_MODAL',
      },
      {
        privId: 1422040,
        menuId: 3220500,
        menuName: 'Dropdown',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 3190500,
        menuIndex: 3,
        urlAddr: '/ui/dropdown',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'DROPDOWN',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_DROPDOWN',
      },
      {
        privId: 1462040,
        menuId: 3260500,
        menuName: 'tabs',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 3190500,
        menuIndex: 7,
        urlAddr: '/ui/tabs',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'TABS',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_TABS',
      },
      {
        privId: 1432040,
        menuId: 3230500,
        menuName: 'Charts',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 3190500,
        menuIndex: 4,
        urlAddr: '/ui/charts',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'CHARTS',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_CHARTS',
      },
      {
        privId: 1412040,
        menuId: 3210500,
        menuName: 'Cards',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 3190500,
        menuIndex: 2,
        urlAddr: '/ui/cards',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'CARDS',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_CARDS',
      },
      {
        privId: 1472040,
        menuId: 3270500,
        menuName: 'other',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 3190500,
        menuIndex: 8,
        urlAddr: '/ui/other',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'OTHER',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_OTHER',
      },
      {
        privId: 1452040,
        menuId: 3250500,
        menuName: 'Pop',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 3190500,
        menuIndex: 6,
        urlAddr: '/ui/pop',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'POP',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_POP',
      },
      {
        privId: 991762,
        menuId: 2769963,
        menuName: '划配规则管理2222',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 2769961,
        menuIndex: 1,
        menuDesc: '划配规则管理',
        urlAddr:
          '[iframe]http://10.45.47.18:8088/mst-pc/web/main.html?page=modules/locrule/views/LocRuleView',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'HPGZGL',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_RULE_MGR',
      },
      {
        menuId: 3190501,
        menuName: '布局样例',
        menuLevel: 0,
        menuType: '1000',
        menuTypeName: '目录菜单',
        parMenuId: 0,
        menuIndex: 1,
        menuDesc: '布局样例',
        urlAddr: 'Views',
        statusCd: '1000',
        firstLetter: 'BJYL',
        iconUrl: 'icon-gene-man-manager',
        menuCode: 'TYMH_MENU_ZJYL',
      },
      {
        privId: 14520402,
        menuId: 31905012,
        menuName: '通栏1',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 3190501,
        menuIndex: 6,
        urlAddr: '/demo/bulletin/manage',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'TL1',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_POP',
      },
      {
        privId: 14520403,
        menuId: 31905013,
        menuName: '通栏2',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 3190501,
        menuIndex: 6,
        urlAddr: '/demo/authManage/roleManage',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'TL2',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_POP',
      },
      {
        privId: 14520404,
        menuId: 31905014,
        menuName: '双栏自适应',
        menuLevel: 1,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 3190501,
        menuIndex: 6,
        urlAddr: '/demo/authManage/menuManage',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'SLZXY',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_POP',
      },
      {
        menuId: 2769938,
        menuName: '第三方集成样例',
        menuLevel: 0,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 0,
        menuIndex: 1,
        menuDesc: '第三方集成样例',
        urlAddr: '[iframe]http://www.baidu.com',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'JCDSFYL',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_AN',
      },
      {
        menuId: 31905012,
        menuName: '被集成样例',
        menuLevel: 0,
        menuType: '1100',
        menuTypeName: '叶子菜单',
        parMenuId: 0,
        menuIndex: 1,
        menuDesc: '被集成样例',
        urlAddr: '/demo/bulletin/manage?viewMode=inner&bss3SessionId=123456',
        systemCode: '727001',
        statusCd: '1000',
        firstLetter: 'JCDSFYL',
        iconUrl: 'icon-gene-man-manager',
        paramEncryptType: '1000',
        menuOpenMode: '1',
        menuCode: 'TYMH_MENU_AN',
      },
    ]);
  },
  'GET /orgauth/FuncMenuController/selectMenuByLetter.do': (req, res) => {
    res.status(200).send([
      [
        {
          title: 'A',
          menus: [
            {
              privId: 991747,
              menuId: 2769938,
              menuName: '内嵌百度',
              menuLevel: 2,
              menuType: '1100',
              menuTypeName: '叶子菜单',
              parMenuId: 276649,
              menuIndex: 2,
              menuDesc: '内嵌百度',
              urlAddr: '[iframe]http://www.baidu.com',
              systemCode: '727001',
              statusCd: '1000',
              firstLetter: 'APPBBPZ',
              iconUrl: 'icon-gene-man-manager',
              paramEncryptType: '1000',
              menuOpenMode: '1',
              menuCode: 'TYMH_MENU_081',
            },
          ],
        },
        {
          title: 'B',
          menus: [
            {
              privId: 89203,
              menuId: 277023,
              menuName: '标签管理',
              menuLevel: 2,
              menuType: '1100',
              menuTypeName: '叶子菜单',
              parMenuId: 2770043,
              menuIndex: 2,
              urlAddr: '[iframe]http://122.192.9.52:20121/ire/labelManage/?sso=1',
              systemCode: '727005',
              statusCd: '1000',
              firstLetter: 'BQGL',
              iconUrl: 'icon-gene-man-manager',
              paramEncryptType: '1000',
              menuOpenMode: '1',
              menuCode: 'MKT0_MENU_LABEL',
            },
            {
              privId: 1402040,
              menuId: 3200500,
              menuName: 'Buttons',
              menuLevel: 1,
              menuType: '1100',
              menuTypeName: '叶子菜单',
              parMenuId: 3190500,
              menuIndex: 1,
              menuDesc: '按钮',
              urlAddr: '/ui/buttons',
              systemCode: '727001',
              statusCd: '1000',
              firstLetter: 'BUTTONS',
              iconUrl: 'icon-gene-man-manager',
              paramEncryptType: '1000',
              menuOpenMode: '1',
              menuCode: 'TYMH_MENU_AN',
            },
          ],
        },
      ],
    ]);
  },
  'GET /orgauth/SysuserCollectionController/getCollectionMenu.do': (req, res) => {
    res.status(200).send([]);
  },
  'PUT /orgauth/SysuserRecentMenuController/updateRecentMenu.do': (req, res) => {
    res.status(200).send('1');
  },
  'GET /orgauth/FuncMenuController/selectMenuInfoById.do': (req, res) => {
    res.status(200).send({ menuName: 'XXX' });
  },
};

export default delay(proxy, defaultSettings.delay);
